<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="format-detection" content="address=no" />
    <meta name="format-detection" content="date=no" />
    <title>公共win</title>
    <link href="../css/aui.css" rel="stylesheet" type="text/css">
    <link href="../css/index.css" rel="stylesheet" type="text/css">
    <link href="../css/public_win.css" rel="stylesheet" type="text/css">
    <link href="../css/public.css" rel="stylesheet" type="text/css">
    <style type="text/css">
        header .public_header .public_title, .right_title_btn span {
            font-weight: bolder;
        }
        .public_header .right_title_btn.cancle {
            padding: 0 0 0 0.75rem;
            justify-content: flex-start;
        }
        .public_header .public_title {
            padding-left: 0;
        }
    </style>
</head>

<body>
    <div class="vueApp" v-cloak>
        <header>
            <div class="public_header">
                <!-- <div class="back_img" tapmode @click="fnBack()" :style="{color:'#fff'}">取消</div> -->
                <div class="right_title_btn cancle" tapmode @click="fnBack()">
                    <span :style="{color:'#fff'}">取消</span>
                </div>
                <span class="public_title">选择收货地址</span>
                <div class="right_title_btn" tapmode @click="fnSubmit()">
                    <span :style="{color:'#fff'}">确定</span>
                </div>
            </div>
        </header>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/vue.min.js"></script>
<script type="text/javascript" src="../script/service/service-app.js"></script>
<script type="text/javascript" src="../script/service/service-tool.js"></script>
<script type="text/javascript" src="../script/service/service-font.js"></script>
<script type="text/javascript" src="../script/service/service-user.js"></script>
<script type="text/javascript" src="../script/service/service-tabbar.js"></script>
<script type="text/javascript">
    var vm;
    var parameter = {};
    var USER, $S;
    apiready = function () {
        USER = USER();
        $S = SERVICE();
        localStorage.safeTop = api.safeArea.top; //获取顶部状态栏的高度
        localStorage.safeBottom = api.safeArea.bottom; //获取底部栏的高度
        console.log(JSON.stringify(api.pageParam) + '=====pageParam');
        parameter = api.pageParam;
        fnInit();
        api.addEventListener({
            name: 'keyback'
        }, function (ret, err) {
            fnBack();
        });
    }

    function fnInit() {
        vm = new Vue({
            el: ".vueApp",
            data: {},
            mounted: function () {
                this.$nextTick(function () {
                    fixStatusBar();
                    //渲染之后打开页面，为了准确获取header的高
                    var _headerH = AD('header').offsetH();
                    parameter.headerH = _headerH;
                    var _footerH = localStorage.safeBottom;
                    parameter.footerH = _footerH;
                    var frmUrl = './teacher/my_address.html';
                    var param = {
                        name: 'my_address_frm',
                        url: frmUrl,
                        useWKWebView: true,
                        reload: true,
                        bgColor: 'rgba(0,0,0,0)',
                        rect: {
                            x: 0,
                            y: _headerH,
                            w: "auto",
                            h: api.winHeight - _headerH - _footerH
                        },
                        softInputMode: 'resize',
                        pageParam: {
                            isSelectAddress: true,
                            winName: parameter.winName
                        }
                    }
                    fnOpenFrame(param);
                })
            },
            methods: {
                fnSubmit: function () {
                    api.execScript({
                        name: api.winName,
                        frameName: 'my_address_frm',
                        script: 'handleHeaderConfirm();'
                    });
                }
            }
        })
    }
    //页面返回
    function fnBack() {
        fnDelayCloseWin(0);
    }
</script>

</html>
